﻿using BLL;
using WcfServices.ServiceInterfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Text;
using WcfServices.Utilities;
using EntitiesLayer;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace WcfServices
{
    [ServiceContract(Namespace = "")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class PagosService
    {
        private GestorPagos gestorPagos;
        public PagosService() 
        {
            gestorPagos = new GestorPagos();
        }


       [OperationContract]
        public string listarClientes() 
       {
           IEnumerable<Pago> lista = Util.interceptWithReturn(gestorPagos.listarPagos);
           if (lista != null)
               return JsonConvert.SerializeObject(lista, new StringEnumConverter());

           return "";
       }

        // Agregue aquí más operaciones y márquelas con [OperationContract]
    }
}
